/*
Autor: Alexander Savochkin, 2010
New BSD License
*/

#pragma once

#include <map>
#include <string>

#include "IOperatedInput.h"
#include "Config.h"

using std::map;
using std::string;


namespace SRCLF {

using Config::Configuration;

namespace IO {

	class OperatedInputFactory
	{
	public:
		virtual ~OperatedInputFactory() {};
		virtual IOperatedInput* newInstance(const string& name, const Configuration& config) = 0;
	};

	//Default factory for IOperatedInput children (template parameter TOperatedInput).
	//TOperatedInput must have constructor TOperatedInput(const string& name, const Configuration& config). 
	template<class TOperatedInput>
	class DefaultOperatedInputFactory : public OperatedInputFactory
	{
	public:
		virtual IOperatedInput* newInstance(const string& name, const Configuration& config)
		{
			return new TOperatedInput(name, config);
		}
	};

} //namespace IO
} //namespace SRCLF
